using Avalonia.Controls;
using Avalonia.Interactivity;
using AvaloniaApplication.ViewModels;
using System.Reactive;
using ReactiveUI;
using Avalonia;
using Avalonia.Metadata;
using System.Diagnostics;
using System;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CSharp;
using Avalonia.Media;

namespace AvaloniaApplication.Views
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            var source = new Subject<string>();



            var subscription = txtAntest.Bind(TextBlock.TextProperty, source.Select(x => "tiaojian :" + x));

            source.OnNext("hello");

            source.OnNext("world");

            //subscription.Dispose();

            inint(source);
        }

        public async void inint(Subject<string> source)
        {
            await Task.Delay(2000);

            source.OnNext("666");
        }

    }
}